function debounce(func, delay) {
    let timeoutId;
  
    return function () {
      const context = this;
      const args = arguments;
  
      clearTimeout(timeoutId);
  
      timeoutId = setTimeout(function () {
        timeoutId = null;
        func.apply(context, args);
      }, delay);
    };
  }
  
  export { debounce };
  